<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div>
        用户名
        <input type="text" value="邮箱/ID/手机号">
    </div>
    <script>
        var text = document.querySelector('input');
        text.onfocus = function() {
            if (this.value === '邮箱/ID/手机号') {
                this.value = '';
            }
        }
        text.onblur = function() {
            if (this.value === '') {
                this.value = '邮箱/ID/手机号';
            }
        }
    </script>
</body>

</html>